Package org.openquark.cal_Cal_Core_Prelude

Source Code of org.openquark.cal_Cal_Core_Prelude.Concat_String

package org.openquark.cal_Cal_Core_Prelude;

import org.openquark.cal.internal.runtime.lecc.RTData;
import org.openquark.cal.internal.runtime.lecc.RTExecutionContext;
import org.openquark.cal.internal.runtime.lecc.RTResultFunction;
import org.openquark.cal.internal.runtime.lecc.RTSupercombinator;
import org.openquark.cal.internal.runtime.lecc.RTValue;
import org.openquark.cal.runtime.CALExecutorException;

public final class Concat_String extends RTSupercombinator {
  /**
   * Singleton instance of this class.
   */
  public static final Concat_String $instance = new Concat_String();

  private Concat_String() {
  }

  public final int getArity() {
    return 1;
  }

  public final java.lang.String getModuleName() {
    return "Cal.Core.Prelude";
  }

  public final java.lang.String getUnqualifiedName() {
    return "concatString";
  }

  public final java.lang.String getQualifiedName() {
    return "Cal.Core.Prelude.concatString";
  }

  /**
   * f
   * This method implements the function logic of the CAL function Cal.Core.Prelude.concatString
   */
  public final RTValue f(final RTResultFunction $rootNode, final RTExecutionContext $ec) throws CALExecutorException {
    // Arguments
    RTValue listOfStrings = $rootNode.getArgValue();

    // Release the fields in the root node to open them to garbage collection
    $rootNode.clearMembers();
    return
      f1S(
        RTValue.lastRef(
          listOfStrings.evaluate($ec),
          listOfStrings = null),
        $ec);
  }

  /**
   * f1L
   * This method implements the function logic of the CAL function Cal.Core.Prelude.concatString
   */
  public final RTValue f1L(RTValue listOfStrings, RTExecutionContext $ec) throws CALExecutorException {
    return
      f1S(
        RTValue.lastRef(
          listOfStrings.evaluate($ec),
          listOfStrings = null),
        $ec);
  }

  /**
   * f1S
   * This method implements the function logic of the CAL function Cal.Core.Prelude.concatString
   */
  public final RTValue f1S(RTValue listOfStrings, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    return
      RTData.CAL_String.make(
        (((java.lang.StringBuilder)(java.lang.Object)
          Fold_Left_Strict.$instance.f3S(
            J_String_Builder__append2.$instance,
            RTData.CAL_Opaque.make(new java.lang.StringBuilder()),
            listOfStrings.getValue(),
            $ec).evaluate(
            $ec).getOpaqueValue())).toString());
  }

  /**
   * fUnboxed1S
   * This method implements the logic of the CAL function Cal.Core.Prelude.concatString
   * This version of the logic returns an unboxed value.
   */
  public final java.lang.String fUnboxed1S(RTValue listOfStrings, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    return
      (((java.lang.StringBuilder)(java.lang.Object)
        Fold_Left_Strict.$instance.f3S(
          J_String_Builder__append2.$instance,
          RTData.CAL_Opaque.make(new java.lang.StringBuilder()),
          listOfStrings.getValue(),
          $ec).evaluate(
          $ec).getOpaqueValue())).toString();
  }

}
TOP

Related Classes of org.openquark.cal_Cal_Core_Prelude.Concat_String

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.